package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingStudentRecordMapper;
import com.ruoyi.teaching.domain.TeachingStudentRecord;
import com.ruoyi.teaching.service.ITeachingStudentRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 学生记上课Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-20
 */
@Service
public class TeachingStudentRecordServiceImpl implements ITeachingStudentRecordService 
{
    @Autowired
    private TeachingStudentRecordMapper teachingStudentRecordMapper;

    /**
     * 查询学生记上课
     * 
     * @param recordId 学生记上课主键
     * @return 学生记上课
     */
    @Override
    public TeachingStudentRecord selectTeachingStudentRecordByRecordId(Long recordId)
    {
        return teachingStudentRecordMapper.selectTeachingStudentRecordByRecordId(recordId);
    }

    /**
     * 查询学生记上课列表
     * 
     * @param teachingStudentRecord 学生记上课
     * @return 学生记上课
     */
    @Override
    public List<TeachingStudentRecord> selectTeachingStudentRecordList(TeachingStudentRecord teachingStudentRecord)
    {
        return teachingStudentRecordMapper.selectTeachingStudentRecordList(teachingStudentRecord);
    }

    /**
     * 新增学生记上课
     * 
     * @param teachingStudentRecord 学生记上课
     * @return 结果
     */
    @Override
    public int insertTeachingStudentRecord(TeachingStudentRecord teachingStudentRecord)
    {
        teachingStudentRecord.setCreateTime(DateUtils.getNowDate());
        return teachingStudentRecordMapper.insertTeachingStudentRecord(teachingStudentRecord);
    }

    /**
     * 修改学生记上课
     * 
     * @param teachingStudentRecord 学生记上课
     * @return 结果
     */
    @Override
    public int updateTeachingStudentRecord(TeachingStudentRecord teachingStudentRecord)
    {
        teachingStudentRecord.setUpdateTime(DateUtils.getNowDate());
        return teachingStudentRecordMapper.updateTeachingStudentRecord(teachingStudentRecord);
    }

    /**
     * 批量删除学生记上课
     * 
     * @param recordIds 需要删除的学生记上课主键
     * @return 结果
     */
    @Override
    public int deleteTeachingStudentRecordByRecordIds(String recordIds)
    {
        return teachingStudentRecordMapper.deleteTeachingStudentRecordByRecordIds(Convert.toStrArray(recordIds));
    }

    /**
     * 删除学生记上课信息
     * 
     * @param recordId 学生记上课主键
     * @return 结果
     */
    @Override
    public int deleteTeachingStudentRecordByRecordId(Long recordId)
    {
        return teachingStudentRecordMapper.deleteTeachingStudentRecordByRecordId(recordId);
    }
}
